<?php

namespace App\admin;

use Illuminate\Database\Eloquent\Model;

class adminUser extends Model
{
    protected $table = 'storeAdmin';

    //验证用户输入的是否为管理员
    public function checkAdminUser($request)
    {
    	
    	
    	//获取用户输入的用户名
    	$name = $request->input('adminName');
    	
    	//去数据库匹配这个用户名信息
    	$ob = $this->where('adminName',$name)->first();

    	if ($ob){

    		if (md5($request->input('adminPassword')) == $ob->adminPass) {

    			// $pass = $ob->adminPass;
    			
    			return $ob;
    		}
    	}

    	return null;
    }
}
